import request from "../utils/request"

export function getBanners(query){
    return request({
        url: "/wechat/api/ad/adList",
        method: "get",
        params: query
    });
}

export function getCategory(query){
    return request({
        url: "/wechat/api/catalog/getCatalogPage",
        method: "get",
        params: query
    });
}


export function getGoodsSpike(query) {
    return request({
        url: "/wechat/api/goods/spikePage",
        method: "get",
        params: query
    });
}

export function getGoodsList(query){
    return request({
        url: "/wechat/api/goods/searchGoodsList",
        method: "get",
        params: query
    });
}

export function getNewGoodsList(query){
    // console.log(query)
    return request({
        url: "/wechat/api/goods/newGoodsList",
        method: "get",
        params: query
    });
}


export function searchHot(query) {
    return request({
        url: "/wechat/api/goods/userSearchGoodsLogsTop",
        method: "get",
        params: query
    });
}


export function searchHistory(query) {
    return request({
        url: "/wechat/api/goods/userSearchGoodsLogs",
        method: "get",
        params: query
    });
}
export function search(query) {
    return request({
        url: "/wechat/api/goods/searchGoodsList",
        method: "get",
        params: query
    });
}

export function getSpikelist(query) {
    return request({
        url: "/wechat/api/goods/spike",
        method: "get",
        params: query
    });
}

export function getGoodsDetail(query){
  return request({
    url: "/wechat/api/goods/detail",
    method: "get",
    params: query
  });
}

export function createOrder(query){
  return request({
    url: "/wechat/api/order/submitOrder",
    method: "post",
    params: query
  })
}

export function getOrderList(query){
  return request({
    url: "/wechat/api/order/list",
    method: "post",
    params: query
  });
}

export function getOrderDetail(query){
    return request({
        url: "/wechat/api/order/detail",
        method: "get",
        params: query
    });
}

export function getShipping(query){
    return request({
        url: "/wechat/api/order/queryOrderTraces",
        method: "get",
        params: query
    });
}

export function orderPay(query){
  return request({
    url: "/wechat/api/pay/prepay",
    method: "post",
    params: query
  });
}

export function orderCancel(query){
  return request({
    url: "/wechat/api/order/cancelOrder",
    method: "post",
    params: query
  });
}

export function orderConfirm(query){
  return request({
    url: "/wechat/api/order/confirmOrder",
    method: "get",
    params: query
  });
}

export function spikeList(){
    return request({
        url: "/wechat/api/goods/spike",
        method: "get"
    });
}

export function getSignPackage(data) {
    return request({
        url: "/wechat/authorize/get",
        method: "get",
        params: data
    });
}

export function wxPay() {
    // return request({
    //     url: "/api/goods/spike",
    //     method: "get"
    // });
}

